/** @format */

//
// FileName layout
// ProjectName tsadmin
// ComputerUser gys
// Author 区区电脑
// Email 1573580882@qq.com
// Date 2021/5/28 11:47 上午
// Copyright © 2021 gys. All rights reserved.

const layout = {
	state: {
        // 布局类型
        layoutType: "pc",
		// 侧边栏折叠状态
		sidebarCollapsed: document.documentElement.clientWidth < 750,
        // 侧边栏菜单
        sideMenus: [],
        // 框架容器高度
        containerHeight: document.documentElement.clientHeight,
	},
	mutations: {
		sidebarCollapsed(state, value) {
			state.sidebarCollapsed = value;
		},
        sideMenus(state, value) {
            state.sideMenus = value;
        },
        setContainerHeight(state, value) {
            state.containerHeight = value;
        },
        setLayoutType(state, value) {
            state.layoutType = value;
        }
	},
	actions: {
		sidebarCollapsed({ commit }, value) {
			commit("sidebarCollapsed", value);
		},
        sideMenus({commit}, value) {
            commit("sideMenus", value)
        },
        setContainerHeight({commit}, value) {
            commit("setContainerHeight", value)
        },
        setLayoutType({commit}, value) {
            commit("setLayoutType", value)
        }
	},
};

export default layout;
